﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;

namespace Project
{
    class sqlCommands
    {
      
        
        
        public string searchStudent(string category)
        {
            
            return "select * from student";


        }

        public string studentDetail(string id)
        {

            return "select * from student where studentID= '" + id + "'";



        }

        public string studentLoan(string id)
        {

            return "select * from loan where (sID = '"+id+"' AND status = 'rented')";


        }
        public string updateStudent(string name, string id)
        {

            return "UPDATE student SET fName = '" + name + "' WHERE studentID = '" + id + "';";


        }

        public string studentLoanReturn(string id)
        {

            return "select * from loan where (sID = '" + id + "' AND status = 'returned')";


        }

        public string studentHold(string id)
        {

            return "select * from loan where hold = '" + id + "'";


        }
        public string searchProd(string category)
        {

            return "select * from Item";


        }


        public string itemDetail(string id)
        {

            return "select * from item where ID= " + id + "";



        }



        public string itemDetails(string id)
        {

            return "select * from loan where (ID= " + id + " and status = 'rented')";



        }

        public string itemHistory(string id)
        {

            return "select * from loan where iID= '" + id + "'";



        }




        public string sqlforCalender(string a, string b, string check, string rnt)
        {

            if (rnt == "Yes")
            {
                return "select * from loan";
            }
            else
                return "select * from loan where status = 'rented'";
        }


    }
}
